/**
  ******************************************************************************
  * @file    debug.h
  * @author  HUGE-IC Application Team
  * @version V1.0.0
  * @date    01-05-2021
  * @brief   Main program body header file
  ******************************************************************************
  * @attention
  *
  * <h2><center>&copy; COPYRIGHT 2021 HUGE-IC</center></h2>
  *
  *
  */ 
  
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __DEBUG_H__
#define __DEBUG_H__

#ifdef __cplusplus
 extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
#define SYSCLK                  (32000000UL)
#define DEBUG_BAUD              (1000000UL)//(1000000UL)//(115200UL)
#define USER_UART_BAUD			((SYSCLK-DEBUG_BAUD)/DEBUG_BAUD)
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/
     
#define TEST_SIGNAL_EN			0


#define UART_PRINT_EN			0



#if (UART_PRINT_EN)



//#define debug_putchar(x) {while(!(UART1_STA & UART_TX_DONE(0x01))); UART1_DATA = x;}

void debug_init(void);
void LOG_Str(char *pStr);
void LOG_StrU(char *str,u32 x);
void LOG_StrU8X(char *str,u8 x);
void LOG_StrU16X(char *str,u16 x);
void LOG_StrU32X(char *str,u32 x);
void LOG_E(char *str,u16 x);
//void print_x(u32 uData,u8 num);
void print_u8X(u8 x);
void debug_putchar(u8 uart_data);


#else

#define debug_init() 			;
#define LOG_Str(x) 			;
#define LOG_StrU8X(str,x) 		;
#define LOG_StrU16X(str,x) 		;
#define LOG_StrU32X(str,x) 		;
#define LOG_StrU(str,x)		;
#define LOG_E(str,x)		;
//#define print_x(x,y)		;
#define debug_putchar(x)	;
#define print_u8X(x)	;

#endif



#ifdef __cplusplus
}
#endif

#endif //__DEBUG_H__

/**
  * @}
  */

/**
  * @}
  */

/*************************** (C) COPYRIGHT 2021 HUGE-IC ***** END OF FILE *****/
